/**
 * This is import files what we need
 */
import java.util.Random;


/**
 * This is a class of hangman to build random words.
 * @author Acie park
 * @version 1.0
 */

public class Hangman {
	
	/**
	 * The given list. This program will pick up an one word randomly.
	 */
	public static final String[] WORDLIST = new String[] { "gypsy", "hangman", "ocean",
			"fog", "copyrightable", "calculator", "wordlist", "daffodil",
			"college", "subtitle", "document", "emphasis", "articulate",
			"agree", "refrigerator", "domination", "handsome", "television",
			"operation", "disease"};

	/**
	 * Answer string value
	 */
	private static String Answer = "";
	
	/**
	 * Random number
	 */
	private static int Rannum = 0;
    
	/**
     * This is a constructor to reset;
     */
    public Hangman(){
    	reset();
    }
    
    /**
     *  To simply pick up one word in wordlist by using random method.
     */
    public static void reset(){
    	final Random rand = new Random();
		Rannum = rand.nextInt(WORDLIST.length);
		Answer = WORDLIST[Rannum];
    }
    
    /**
     *  To return picked word.
     * @return answer
     */
    public String getAnswer() {
        return Answer;
    }
    
    /**
     * This is a toString method.
     * @return tostring.
     */
    @Override
    public String toString() {
    	return super.toString();
    }
}
